onCreateDialog

open fun onCreateDialog(@Nullable savedInstanceState: Bundle): Dialog(source)

Override to build your own custom Dialog container. This is typically used to show an AlertDialog instead of a generic Dialog; when doing so, onCreateView does not need to be implemented since the AlertDialog takes care of its own content.

This method will be called after onCreate and immediately before onCreateView. The default implementation simply instantiates and returns a Dialog class.

Note: DialogFragment own the Dialog.setOnCancelListener and Dialog.setOnDismissListener callbacks. You must not set them yourself. To find out about these events, override onCancel and onDismiss.

Return

Return a new Dialog instance to be displayed by the Fragment.

Parameters

savedInstanceState

The last saved instance state of the Fragment, or null if this is a freshly created Fragment.